//
//  CardInfo.m
//  GoodWayClient
//
//  Created by HuiDong on 15/12/22.
//  Copyright © 2015年 HuiDong. All rights reserved.
//

#import "CardInfo.h"

@implementation CardInfo

+ (instancetype)CardInfoWithDic:(NSDictionary *)dic
{
    return [[self alloc] initWithDic:dic];
}
- (instancetype)initWithDic:(NSDictionary *)dic
{
    if (self = [super init]) {
        NSNumberFormatter* numberFormatter = [[NSNumberFormatter alloc] init];
        self.cardInfoId = [[numberFormatter stringFromNumber:dic[@"Id"]] intValue];
        self.CardID = [[numberFormatter stringFromNumber:dic[@"CardID"]] intValue];
        self.CardNum = dic[@"CardNum"];
        self.BeginTime = (NSDate *)dic[@"BeginTime"];
        self.EndTime = (NSDate *)dic[@"EndTime"];
        self.Description = dic[@"Description"];
        self.Money = [[numberFormatter stringFromNumber:dic[@"Money"]] doubleValue];
        self.Status = [[numberFormatter stringFromNumber:dic[@"Status"]] intValue];
        self.NickName = dic[@"NickName"];
        self.PhoneNum = dic[@"PhoneNum"];
        self.UseTime = (NSDate *)dic[@"UseTime"];
        self.Uid = [[numberFormatter stringFromNumber:dic[@"Uid"]] intValue];
        self.CreateTime = (NSDate *)dic[@"CreateTime"];
    }
    return self;
}

@end
